<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<title>XXX</title>
</head>
<body>
<form>
	<div id="container" style="margin:50px;">
		
		<div id="test-event-outer" style="background-color:#3e8;width:40%;height:300px;padding:40px;">
			<div id="test-event-middle" style="background-color:#4f9;width:auto;height:auto;padding:40px;">
				<div id="test-event-inner" style="background-color:#8f2;width:auto;height:auto;padding:40px;"></div>
			</div>
		</div>
		
	</div>
	
</form>
<script>

/*********************************************/
addEvent(get("test-event-outer"), "click", function(){
	alert("outer");
});
addEvent(get("test-event-middle"), "click", function(){
	alert("middle");
}, true);
addEvent(get("test-event-inner"), "click", function(){
	alert("inner");
});
/*********************************************/
function get(id){
	return document.getElementById(id);
}
function addEvent(doms, eName, handler, bCaptrue){
	var action = function(d){
		if(window.attachEvent){
			d.attachEvent("on"+eName, handler);
		}else{
			d.addEventListener(eName, handler, bCaptrue);
		}
	}
	if(doms.constructor == Array)
}
</script>
</body>
</html>
